function saveRole(){
  var roleType;
  var role = document.form1.role;
  if(role.length==undefined){
      roleType = document.form1.roleType.value;
      if (roleType == "系统定义"){
        roleType="XT";
      }
      else{
        roleType="ZD";
      }
      roleCode.value=role.value+"$#$" + document.form1.roleType.value
  }
  else{
    for (i=0;i<role.length;i++){
    if (role[i].checked == true){
      roleType = document.form.roleType[i].value;
      if (roleType == "系统定义"){
        roleType="XT";
      }
      else{
        roleType="ZD";
      }
    roleCode[i].value=role[i].value +"$#$" + document.form1.roleType[i].value;
    }
   }
  }
  document.form1.action=saveAction;
  document.form1.submit();
}
